<script>
// import pageAnimation from './components/page-animation';
import { sqlHelper } from 'comman/sql/sqlHelper';
import { tempTable } from 'comman/sql/tempTable';
import { tempShortData } from 'comman/sql/tempShortData';
import { Commnd } from 'comman/sql/Commnd';
let cj = require('crypto-js');
export default {
	// mixins: [pageAnimation],
	onLaunch: function(e) {
		// this.CheckVersion().then((result) => {
		// 	if (result.data.ActionOK) {
		// 		uni.navigateTo({
		// 			url: "/pages/home/Progress"
		// 		})
		// 	}
		// })
	},
	methods: {},
	onShow: function(e) {
		console.log('app vue OnShow', e);
		var change = this.changeData();
		const nologin_page = ['pages/login/login', 'pages/pwd/pwd'];
		console.log(e.query);
		if (!change) {
			let redirectUrl = e.path;
			let keys = Object.keys(e.query);
			if (keys.indexOf('redirectUrl') == -1) {
				redirectUrl += '?';
				keys.forEach((key, index) => {
					redirectUrl += key + '=' + e.query[key];
					if (keys.length - 1 != index) redirectUrl += '&';
				});
			}
			uni.navigateTo({
				url: '/pages/login/login?redirectUrl=/' + encodeURIComponent(redirectUrl)
			});
		} else {
			if (nologin_page.indexOf(e.path) >= 0) {
				uni.switchTab({
					url: '/pages/home/index'
				});
			}
		}
		console.log('App Show');
	},
	onHide: function(e) {
		console.log('app vue onHide', e);
		console.log('App Hide');
	},
	onError: function(e) {
		console.log('app error', e);
	}
};
</script>

<style>
/* 头条小程序需要把 iconfont 样式放到组件外 */
@import 'components/m-icon/m-icon.css';
@import 'comman/uni.css';

/*每个页面公共css */
page {
	min-height: 100%;
	display: flex;
	font-size: 16px;
}

/* #ifdef MP-BAIDU */
page {
	width: 100%;
	height: 100%;
	display: block;
}

swan-template {
	width: 100%;
	min-height: 100%;
	display: flex;
}

/* 原生组件模式下需要注意组件外部样式 */
custom-component {
	width: 100%;
	min-height: 100%;
	display: flex;
}

/* #endif */

/* #ifdef MP-ALIPAY */
page {
	min-height: 100vh;
}

/* #endif */

/* 原生组件模式下需要注意组件外部样式 */
m-input {
	width: 100%;
	/* min-height: 100%; */
	display: flex;
	flex: 1;
}

.content {
	display: flex;
	flex: 1;
	flex-direction: column;
	background-color: #efeff4;
	padding: 10px;
}

.input-group {
	background-color: #ffffff;
	margin-top: 20px;
	position: relative;
}

.input-group::before {
	position: absolute;
	right: 0;
	top: 0;
	left: 0;
	height: 1px;
	content: '';
	-webkit-transform: scaleY(0.5);
	transform: scaleY(0.5);
	background-color: #c8c7cc;
}

.input-group::after {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 1px;
	content: '';
	-webkit-transform: scaleY(0.5);
	transform: scaleY(0.5);
	background-color: #c8c7cc;
}

.input-row {
	display: flex;
	flex-direction: row;
	position: relative;
	font-size: 18px;
	line-height: 40px;
}

.input-row .title {
	width: 72px;
	padding-left: 15px;
}

.input-row.border::after {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 8px;
	height: 1px;
	content: '';
	-webkit-transform: scaleY(0.5);
	transform: scaleY(0.5);
	background-color: #c8c7cc;
}

.btn-row {
	margin-top: 25px;
	padding: 10px;
}

button.primary {
	background-color: #0faeff;
}
</style>
